<template>
  <z-block class="z-col right lis-jcsj-zkbz-add-dx">
    <div>
      <el-button @click="add" type="primary" :disabled="edit">新增</el-button>
      <el-button @click="del" type="danger" :disabled="edit">删除</el-button>
      <el-button @click="save" type="primary" :disabled="edit">保存</el-button>
      <el-button @click="query" type="success" :disabled="edit">查询</el-button>
    </div>
    <z-block class="content">
      <z-form-table
        ref="formTable"
        mainId="id"
        highlight-current-row
        border
        :cols="tableCols"
        :data="tableData"
        @current-change="currentRow = $event"
      ></z-form-table>
    </z-block>
  </z-block>
</template>
<script lang="ts" setup>
import { use } from './use'
import { zkbzAddEmits, zkbzAddProps } from '../zkbz-add-dl/prop'
import { tableCols } from './data'
defineOptions({
  name: 'lis-jcsj-zkbz-add-dx'
})
const props = defineProps(zkbzAddProps)
const emit = defineEmits(zkbzAddEmits)
const { tableData, add, formTable, save, del, currentRow, query } = use(props, emit)
</script>
